<? /* license

BilugCMS (http://www.bilug.it) - Content Management System for dynamic web sites
Copyright (C) 2005-2008  Federico Villa and Alessio Loro Piana

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

For reference, contact bilugcms@vilnet.it


license */ ?>
<?
//faccio partire la sessione
session_start();
$idecom=session_id();

?>
<!-- ricerca tra gli articoli -->
<div class="blocco">
	<h3><?=$titolo?></h3>	
<form name="ecommercericerca" method="post" action="index.php?pag=ecommerce.php" enctype="multipart/form-data">
<input type="hidden" name="cerca" value="si"/>
<input type="text" name="parola" id="textlato">
<input type="submit" value="Cerca" id="bottomlato">
</form>
<br>
<h3>Categorie:</h3>	

<!-- elenco categorie -->
<?
#$str="SELECT id,categoria FROM ecommercecategoria order by categoria";
$str="SELECT id,categoria, riservato FROM ecommerce WHERE riservato = 0 GROUP BY categoria ORDER BY categoria";
$risultato=mysql_query($str);
if (mysql_num_rows($risultato)>0)
{
	echo "<ul>";
	echo"<li><a href=\"index.php?pag=ecommerce.php\">TUTTE</a></li>";
	while($control=mysql_fetch_row($risultato))
            {
            echo "
            <li><a href=\"index.php?pag=ecommerce.php&categoria=$control[1]\">$control[1]</a></li>
            ";
            }
   echo "</ul>";
}
else
	echo "<ul><li>Nessun Argomento</li></ul>";


?>

<!-- include carrello se attivo o no include se disattivo-->
<?/*
$carrello2=$_GET['carrello2'];
if($carrello2!="")
{
	$_SESSION['carrello2']="si";
}
$carrello2=$_POST['carrello2'];
if($carrello2!="")
{
	if($carrello2=="si")
	{
		$_SESSION['carrello2']="si";
    }
	if($carrello2=="no")
	{
		$_SESSION['carrello2']="no";
		/*	
		session_unset();
		session_destroy();
		*/
 /*   }
}

if($_SESSION['carrello2']=="si")
{
	echo "<br><a href=\"index.php?pag=ecommerce_dettaglio_carrello.php\"><h3>Carrello<img src=\"../img/carrello1.png\" class=\"linkico\"> </h3></a> ";
	include("ecommerce_carrello.php");	
	?>
		<br><br>
		<form name="carrello2" method="post" action="<?$_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
		<input type="hidden" name="carrello2" value="no"/>
		<input type="submit" value="Disattiva carrello" id="bottomlato">
		</form>
	<?
}
if($_SESSION['carrello']=="no" or $_SESSION['carrello']=="")
{
		?>
			<br><br>
			<form name="carrello2" method="post" action="<?$_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
			<input type="hidden" name="carrello2" value="si"/>
			<input type="submit" value="Attiva carrello" id="bottomlato">
			</form>
		<?	
}
*/
	echo "<br><a href=\"index.php?pag=ecommerce_dettaglio_carrello.php\"><h3>Carrello<img src=\"../img/carrello1.png\" class=\"linkico\"> </h3></a> ";
	include("ecommerce_carrello.php");	


?>

</div>
